package com.billdowney.controller.manage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.billdowney.annotation.AuthRoleAllowed;
import com.billdowney.annotation.SystemLogInfo;
import com.billdowney.controller.BaseController;
import com.billdowney.entity.auth.AuthAction;
import com.billdowney.service.interfaces.auth.AuthManageService;
import com.billdowney.util.auth.AuthRoleConst;
import com.billdowney.util.log.SystemLogHandleType;
import com.billdowney.util.return_type.ReturnData;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 权限管理控制器
 * 
 * @author 超级小富翁 - BillDowney
 * @data 2017年8月19日 下午4:26:30
 */
@RestController
@RequestMapping(value = "/authManage")
@Api(tags = "权限管理控制器")
public class AuthManageController extends BaseController {

	@Autowired
	private AuthManageService authManageService;

	@AuthRoleAllowed(AuthRoleConst.ROLE_SUPERADMIN)
	@RequestMapping(value = "/collectAllController", method = { RequestMethod.POST, RequestMethod.GET })
	@SystemLogInfo(value = "查看所有接口，并保存到数据库中", handleType = SystemLogHandleType.save)
	@ApiOperation(value = "查看所有接口", notes = "查看所有系统存在的能够访问接口", response = AuthAction.class)
	public Object collectAllController() {
		return new ReturnData(authManageService.addAllController());
	}

}
